package cn.rzpt.demo.entity;

import java.util.List;

/**
   *  对应tb_user表实体
 * @author zsm
 *
 */
public class User {
	/**
	 * 主键、标识
	 */
	private String id;
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 性别
	 */
	private String gender;
	/**
	 * 密码
	 */
	private String password;
	/**
	 * 电话
	 */
	private String phone;
	/**
	 * 角色id
	 */
	private int roleId;
	/**
	 * 角色信息
	 */
	private Role role;
	/**
	 * 地址列表
	 */
	private List<Address> addresses;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}	
	
	public int getRoleId() {
		return roleId;
	}
	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}
	
	public Role getRole() {
		return role;
	}
	public void setRole(Role role) {
		this.role = role;
	}
	
	public List<Address> getAddresses() {
		return addresses;
	}
	public void setAddresses(List<Address> addresses) {
		this.addresses = addresses;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		StringBuffer sb = new StringBuffer();
		sb.append("{");
		sb.append("id:").append("\"").append(this.id).append("\",");
		sb.append("name:").append("\"").append(this.name).append("\",");
		sb.append("phone:").append("\"").append(this.phone).append("\",");
		sb.append("password:").append("\"").append(this.password).append("\",");
		sb.append("roleId:").append("\"").append(this.roleId).append("\",");
		if(null != role) {
			sb.append("role:").append(role.toString());
		}
		
		sb.append("}");
		
		
		return sb.toString();
	}
}
